package com.sgj.builder.improve;

/**
 * 建造者模式
 * @Author: Guoji Shen
 * @Date: 2021/11/15 9:53
 */
public class Client {
    public static void main(String[] args) {
        // 盖普通房
        CommonHouse commonHouse = new CommonHouse();
        // 准备创建房子的指挥者
        HouseDirector houseDirector = new HouseDirector(commonHouse);
        // 完成盖房子，返回产品
        House house = houseDirector.constructHouse();

        System.out.println("---------------------------");

        // 盖高楼
        HighBuilding highBuilding = new HighBuilding();
        // 重置建造者
        houseDirector.setHouseBuilder(highBuilding);
        // 完成盖房子，返回产品
        House house2 = houseDirector.constructHouse();
    }
}